<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:70px;
		}
	</style>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span9">
				<div class="clear"></div>
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:3px">
					<li class="active">
						<a href="project.html"><i class="icon-th"></i>此项目所有任务</a>
					</li>
					<li style="float:right"><i class="icon-edit"></i><a href="goal.jspx" class="link-black">返回</a></li>
				</ul>
				<div class="wall" style="border-top:none; border:1px solid #dddddd ">
					<c:choose>
						<c:when test="${empty requestScope.userTasklist}">
							<div>
								<div style="margin-left:20px">该项目还没有创建任务</div>
							</div>
						</c:when>
						<c:otherwise>
							<c:forEach items = "${requestScope.userTasklist}" var = "usertask">
							<input id="progress" type="hidden" name="progress" value="${usertask.task.progress}">
							<div style="margin-top:20px">
								<c:choose>
									<c:when test="${usertask.task.progress==-1}">
										<div class="breadcrumb"  style="margin:10px;height:15px"><span style="color:pink"><i class="icon-bookmark"></i><a href="goal.jspx?pmothed=totask&taskid=${usertask.task.id}" >${usertask.task.name}</a></span>[${usertask.user.username}]<span style="margin-left:20px">截止时间：${usertask.task.endtime}</span>
											<c:choose>
												<c:when test="${sessionScope.userProject.role=='manager'}">
													<span style="float:right"><a href="goal.jspx?pmothed=deltask&id=${usertask.task.id}"><i class="icon-trash"></i>删除</a></span>
												</c:when>
												<c:otherwise>
												
												</c:otherwise>
											</c:choose>
											
										</div>
										<p style="margin:2px  ; margin-left:20px">${usertask.task.description}</p>
										<div id="mytask" style="margin:15px;color:red;text-align:center">
											该任务已经过期
										</div>
									</c:when>
									<c:when test="${usertask.task.progress==101}" >
										<div class="breadcrumb"  style="margin:10px;height:15px"><i class="icon-bookmark"></i><a href="goal.jspx?pmothed=totask&taskid=${usertask.task.id}" >${usertask.task.name}</a>[${usertask.user.username}]<span style="margin-left:20px">开始时间：${usertask.task.starttime}</span></div>
										<p style="margin:2px  ; margin-left:20px">${usertask.task.description}</p>
										<div id="mytask" style="margin:15px;color:red;text-align:center">
											该任务未到开始日期
										</div>
									</c:when>
									<c:otherwise >
										<div class="breadcrumb"  style="margin:10px;height:15px"><a href="goal.jspx?pmothed=totask&taskid=${usertask.task.id}" ><i class="icon-bookmark"></i>${usertask.task.name}</a>[${usertask.user.username}]<span style="margin-left:20px">开始时间：${usertask.task.starttime}</span><span style="margin-left:20px">截止时间：${usertask.task.endtime}</span>
											<c:choose>
												<c:when test="${sessionScope.userProject.role=='manager'}">
													<span style="float:right"><a href="goal.jspx?pmothed=edittask&id=${usertask.task.id}"><i class="icon-pencil"></i>编辑</a></span>
												</c:when>
												<c:otherwise>
												
												</c:otherwise>
											</c:choose>
										</div>
										<p style="margin:2px  ; margin-left:20px">${usertask.task.description}</p>
										<c:choose>
											<c:when test="${usertask.task.stat=='新任务'}">
												<div id="myprogress" style="margin:10px">
													<div class="progress progress-success" style="width:90%;color:red; margin-left:20px">
													<div class="bar" style="width: 0%;color:white;text-align:center">0%</div>
													</div>
												</div>
											</c:when>
											<c:when test="${usertask.task.stat=='已完成'}">
												<div id="myprogress" style="margin:10px">
													<div class="progress progress-success" style="width:90%;color:red; margin-left:20px">
													<div class="bar" style="width: 100%;color:white;text-align:center">100%</div>
													</div>
												</div>
											</c:when>
											<c:otherwise>
												<div id="myprogress" style="margin:10px">
													<div class="progress" style="width:90%;color:red; margin-left:20px">
													<div class="bar" style="width: ${usertask.task.progress}%;color:white;text-align:center">${usertask.task.progress}%</div>
													</div>
												</div>
											</c:otherwise>
										</c:choose>
									</c:otherwise>
								</c:choose>
							</div>
							</c:forEach>
						</c:otherwise>
					</c:choose>
				 </div>
		</div>
	</div>
</div>	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>
</html>